﻿<Window x:Class="Aeon.Emulator.Launcher.DriveProperties"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:emu="clr-namespace:Aeon.Emulator;assembly=Aeon.Emulator"
        xmlns:local="clr-namespace:Aeon.Emulator.Launcher"
        Title="Drive Properties" Height="300" Width="450" MinHeight="200" MinWidth="400"
        x:Name="root" Icon="Aeon.ico" ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock Text="Drive Letter:" Margin="0,5" Grid.Column="0" Grid.Row="0" />
            <ComboBox Width="100" Margin="0,2" ItemsSource="{Binding AvailableDriveLetters, ElementName=root}" SelectedItem="{Binding MountedDrive.DriveLetter, ElementName=root}" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left" />
            <TextBlock Text="Drive Type:" Margin="0,5" Grid.Column="0" Grid.Row="1" />
            <ComboBox Width="100" Margin="0,2" SelectedValuePath="Value" SelectedValue="{Binding MountedDrive.DriveType, ElementName=root}" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left">
                <ComboBox.Items>
                    <local:LabeledValue Text="3.5&quot; floppy">
                        <local:LabeledValue.Value>
                            <emu:DriveType>Floppy35</emu:DriveType>
                        </local:LabeledValue.Value>
                    </local:LabeledValue>
                    <local:LabeledValue Text="5.25&quot; floppy">
                        <local:LabeledValue.Value>
                            <emu:DriveType>Floppy525</emu:DriveType>
                        </local:LabeledValue.Value>
                    </local:LabeledValue>
                    <local:LabeledValue Text="Hard disk">
                        <local:LabeledValue.Value>
                            <emu:DriveType>Fixed</emu:DriveType>
                        </local:LabeledValue.Value>
                    </local:LabeledValue>
                    <local:LabeledValue Text="CD-ROM">
                        <local:LabeledValue.Value>
                            <emu:DriveType>CDROM</emu:DriveType>
                        </local:LabeledValue.Value>
                    </local:LabeledValue>
                </ComboBox.Items>
            </ComboBox>
            <TextBlock Text="Mount Source:" Margin="0,5,5,5" Grid.Column="0" Grid.Row="2" />
            <ComboBox Name="sourceComboBox" Margin="0,2" ItemsSource="{Binding Source={x:Static local:LauncherEnvironment.ConfigurationMapper}, Path=DriveConfigurations}" SelectedItem="{Binding ViewCache.SelectedType, ElementName=root}" Grid.Column="1" Grid.Row="2" SelectionChanged="SourceComboBox_SelectionChanged" />
        </Grid>
        <ContentPresenter Name="driveConfigView" Grid.Row="1" Margin="0,5" Content="{Binding ViewCache.SelectedConfigurationView, ElementName=root}" />
        <StackPanel Orientation="Horizontal" FlowDirection="RightToLeft" Grid.Row="2">
            <Button Content="Cancel" Width="60" Height="21" Margin="3" IsCancel="True" />
            <Button Content="OK" Width="60" Height="21" Margin="3" IsDefault="True" Click="OK_Click">
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding ViewCache.SelectedConfigurationView.DriveConfiguration.HasErrors, ElementName=root}" Value="True">
                                <Setter Property="IsEnabled" Value="False" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>
        </StackPanel>
    </Grid>
</Window>
